Fix effecttest LSP helpers after typescript-go update#302
Merged
Conversation
The typescript-go bump in #299 changed the LSP test client so the untyped SendRequestWorker leaves resp.Result as a raw json.Value. Decode results with RequestInfo.UnmarshalResult instead of type-asserting the typed response structs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
The typescript-go submodule bump in #299 changed the upstream LSP test client (
testutil/lsptestutil): the untypedSendRequestWorkernow leavesresp.Resultas a rawjson.Value, with typed decoding moved into the typed helpers viaRequestInfo.UnmarshalResult.Our
internal/effecttesthelpers still type-asserted the typed response structs on the raw result, so 6 tests failed onmain:TestEffectInlayHintsGenSuppression,TestEffectInlayHintsFnSuppression,TestEffectInlayHintsFnUntracedSuppression,TestEffectInlayHintsNonEffectNotSuppressed,TestEffectInlayHintsDisabledPassthrough—Unexpected textDocument/inlayHint response type: jsontext.ValueTestAutoImportEffectStyleConsistency_barrel—unexpected diagnostic response typeFix
Decode the raw results with the matching
RequestInfo.UnmarshalResult(same pattern as upstream's typed helpers):Applied to the inlay hint helper (
inlay_hints_baseline_test.go) and the diagnostic + code action requests inautoimport_style_consistency_test.go. Also includes thego.work.sumrefresh from the submodule dependency update.Validation
pnpm lint— 0 issuespnpm check— cleanpnpm test— full suite passes (previously failing 6 tests now green)🤖 Generated with Claude Code